package com.mpyy.handler.purchase;

import com.mpyy.service.purchase.SearchProIdServiceInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @version 1.0
 * @Descoription SearchProIdHandler
 * @Author CG
 * @date 2022-03-24
 */
@Controller
public class SearchProIdHandler {
    @Autowired
    private SearchProIdServiceInter proIdServiceInter;
    @RequestMapping(value = "/searchProId/{proTypeId}")
    @ResponseBody
    public String searchProId(@PathVariable String proTypeId){
        String searchProId = proIdServiceInter.searchProId(proTypeId);
        if(null!=searchProId&&""!=searchProId){
          return String.valueOf(Integer.parseInt(searchProId)+1);
        }else {
            return String.valueOf(Integer.parseInt(proTypeId)+"001");
        }


    }

}
